Skip to content

Switch node_compat to Node 26.13.1 - #218

Merged
noise64 merged 73 commits into
mainfrom
node-26-target
Nov 27, 2026
Merged

noise64 merged 73 commits into
mainfrom
node-26-target

Conversation

@noise64

@noise64 noise64 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor
  • delivers the Node 26.13.1 target-switch, migration audit and baseline-repair slice of GOL-1947 / NJ-02; does not close the broader consumer/recovery/freeze work
  • re-vendors the suite at 26.13.1 and aligns runtime process metadata (Lithium, ABI 147). Host Node.js/npm remain 22.14.0 / 10.9.2; native addons remain unsupported
  • consolidates Make node_compat config migration lossless and strict #216, Add newer node_compat common helpers and sqlite fixtures #217, Match Node 26 crypto error contracts #219, Make fs.Dir path a brand-checked getter #223 and Make Readable.read return one chunk at a time #225: metadata-preserving migration, newer common helpers/sqlite fixtures, and Node 26 behavior repairs across crypto errors, fs, streams, util/assert, test hooks, net/dns and HTTP. Vigoo subsequently folded Fix SQLite prepare and value contracts [skip ci] #231's SQLite prepare/value contracts into this branch at 242970e7
  • preserves authoritative config on failed migration and compares exact source-span bytes, including whitespace inside literals. Reentrant assert/util comparisons isolate prototype policy and comparison counters. Explicit classifications restore historical public stream/deprecation coverage without weakening generic internals detection
  • merges main at a57ed896, retaining Restore catchable preinit filesystem errors #240's catchable preinit filesystem errors and Add wasm-rquickjs:import-abort and name imported resource methods explicitly #241's import-abort support alongside Switch node_compat to Node 26.13.1 #218/Fix SQLite prepare and value contracts [skip ci] #231. The only manual conflict resolution retains all three independent native process imports; no behavior/design change is authored in this integration. Existing crypto providers, P-521 support, fetch precedence and optimizer/invocation changes remain intact. Node 26 error contracts, cipher-selected PKCS#8 exports, callback dsaEncoding and fallible PKCS#8 entropy are preserved
  • correction c7cb37df awaits asynchronous subtest setup/teardown and mock restoration before settlement, preserving primary failures and eager synchronous execution. Raw P-521 private imports validate exactly 66 bytes before existing-library scalar reduction/public derivation; the custom production JS BigInt point helper is removed and original scalar bytes remain intact for export
  • raw P-521 private import now requires crypto-full. Normal no longer has the JS arithmetic fallback: valid-length keys report an unsupported curve; wrong lengths fail validation first. Noncanonical accepted scalars retain their original raw/JWK encoding. Existing zero/order-multiple imports still reject earlier than Node's later export failure; complete error-order fidelity, cryptographic security and compiled constant-time qualification are not claimed
  • retains the source-bound migration audit and historical evidence: current-suite migration was a byte fixed point; old-to-new replay still exited 101 for 180 manually audited mappings, not a successful automatic replay. Transition JSON and its version-specific report exception are retired together; generic safeguards remain
  • the historical 339-case ledger remains 283 passing / 56 explained gaps: SQLite 30, zstd 10, finite-field DH 9 (open coverage obligations), other 7. This ledger is historical: the now-folded Fix SQLite prepare and value contracts [skip ci] #231 adds a bounded SQLite prepare/value-contract slice, not complete SQLite coverage; zstd remains outside delivery. Passing historical Node 22 forms does not discharge DH obligations. This is not complete NJ-02 or an all-API Node 26 campaign

Validation

  • latest integration df908bf7 has parents 242970e7 and a57ed896. Exact-candidate checks passed: preinit 9; SQLite runtime 14; Node SQLite 32 / 107 ignored; process features, async subtest cleanup and Normal P-521 one each; import-abort 3; report currentness 1; DTS 87. Workspace all-target Clippy (-Dwarnings), all five skeleton Clippy lanes, fmt and diff checks exited 0; Cargo still emitted manifest warnings. Head/tree and clean source state were verified before and after every check. Direct integration assessment is COMPLETE/CLEAR with no integration findings or evidence blockers (nov27-218-df908bf7-local-integration, rev3, in golem-review). Exact-head CI46000316443 completed successfully after the authorized job-specific retry: attempt 2 reports 28 successful validation jobs; publish/release-binaries and separate Proof were skipped. Its API assigns new job IDs throughout, but 27 successful jobs retain identical attempt-1 start/end timestamps and step records; only skeleton Clippy has a new execution interval (13:24:46–13:27:02 UTC). Initial Clippy job 140510172936 failed WASI SDK 25 download with HTTP 403 before Clippy; retry 140532098848 succeeded without a source fix. The 28 successes are the terminal run result, not 28 fresh executions in attempt 2. Previous-head CI remains historical, and neither this assessment nor CI creates a new approval or team approval
  • the first df preinit attempt failed fixture compilation with the WASI SDK environment unset; the corrected environment run passed all nine checks. That initial failure is retained, not counted as a pass. Superseded local b409316e was never published; its optimizer invocation selected no tests because the runtime wrapper supplied an unsupported timing flag
  • historical correction c7cb37df: crypto runtime 52 passed (includes Full/Normal P-521 contracts and three real npm apps), assert runtime 15 passed; Node crypto 196 passed / 199 ignored and mocking 42 passed / 12 ignored; workspace all-target Clippy (-Dwarnings), fmt and diff checks passed. Historical unchanged-production hook/P-521 regressions fail and repaired WASM passes; the stale-host apparent hook pass was discarded. Pinned Node 26 controls support the raw-import contract; deliberate failed child tests make the host-Node hook run exit 1, not an all-green Node run
  • integration at fad0d5f0: all-target build and Clippy, five skeleton Clippy lanes, fmt/diff; crypto runtime 51 passed, Node crypto 196 passed / 199 ignored, util deep equality 1 passed. Native Rust is unchanged by the final two-file cleanup; those five native lanes were not rerun as new c7 results. Shared callback regression assertions fail unchanged WASM and pass repaired WASM; final fixture adds a direct-KeyObject control. Host Node 22.14.0 and 26.13.1 callback controls pass
  • before that integration's final four-file crypto correction: migration 54 passed; report 37 passed / 1 ignored; DTS 87 passed; assert runtime 16, streams 12 and fetch 42 passed; Node assertions 78 passed / 31 ignored, streams 714 / 169 ignored, deprecate 4 / 1 ignored; optimizer qualified-import check and dev-tools checks passed. These broader checks were not repeated as final-correction checks
  • both required model families reviewed the integration and subsequent bounded corrections; both cleared the final two-file cleanup. Existing direct review independently inspected all six complete fad0..c7 diffs/context, exact locked conversion/remainder sources and retained logs: all four concerns are addressed in exact c7 bytes, with no actionable in-scope blocker. Raw findings/dispositions and completed direct assessment are retained in golem-review (local · portal); this is separate from CI and does not transfer an older approval. Earlier changes-required verdicts and the accepted command-level persistence-test rationale remain historical, not relabeled as unanimous clearance
  • historical CI 45387025739 at d235247: Node compatibility 3158 generated cases passed / 7636 ignored; runtime groups 1–9: 591 passed / 4 ignored; fork test-other: 160 CTRF plus 26 non-CTRF tests passed; build, quick-checks, skeleton Clippy and Preview 3 checks passed. One Node shard first failed WASI SDK download (403, before tests), then passed on rerun. These results do not validate c7
  • historical CI 45798881357 at fad0d5f0: all 28 executed jobs succeeded, including eight Node-compat shards, nine runtime groups, stock/fork optimizer lanes, test-other, Preview 3, report and quality checks. Release/publish jobs and separate Proof were skipped. CI 45854299208 passed on exact head c7cb37df4ba788e6d842a66eb996acd7b093ba0d: all 28 executed jobs succeeded; release-binaries, publish and separate Proof were skipped. No Golem consumer/recovery check is claimed. NJ-03 campaign work, runtime behavior, host durability and shipped consumer artifacts remain distinct. Existing P-521 encrypted-DER import and AES-192 normalization gaps are neither added nor claimed fixed

Node compatibility inventory

Comparison: main at a57ed896 (Node 22.14.0) → df908bf7 (Node 26.13.1). The main integration changes no configuration/report inputs; current counts match Vigoo's 242970e7 fold of #231, which adds five runnable selections relative to c7cb37df.

Classification Base Current head
Runnable, CI-enforced classification 3260 3200
Known gap 1191 1299
WASI-impossible 1192 1148
Engine difference 167 167
Unevaluated 0 3840
Node.js internals 1101 1140
Total 6911 10794
Primary 3260/4451 (73.2%) 3200/4499 (71.1%)
Full public 3260/5810 (56.1%) 3200/9654 (33.1%)

These are generated classification inventories, not a paired behavioral measurement or a new-head full-suite pass. The suite and denominators changed; moved/split/removed cases make the runnable decrease non-comparable as a regression count. The historical audit accounts for all 3260 formerly passing cases, including target changes/removals. Earlier baseline repairs in this PR restore 37 runnable selections; one previously unevaluated HTTP-abort case is explicitly a known timeout gap. No ignored or known-gap case is counted as runnable.

@noise64
noise64 changed the base branch from strict-node-compat-migration to main November 18, 2026 08:36
@noise64
noise64 marked this pull request as ready for review November 24, 2026 14:32
@noise64
noise64 marked this pull request as draft November 26, 2026 00:35
@noise64
noise64 marked this pull request as ready for review November 26, 2026 10:33

vigoo commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Reviewed #218 at fad0d5f, excluding the stacked PR changes. Two medium-severity findings need changes:

1. Await asynchronous subtest hooks

Location: test.js:266–289.

The new runHooks loop discards the promises returned by beforeEach/afterEach callbacks. With asynchronous hooks and an awaited child test, executing the unchanged module produces body → child-resolved → before → after. Node 26.13.1 produces before → body → after → child-resolved for the same scenario. The child can run before setup completes, and teardown can outlive child completion and mock restoration. Rejected hook promises also do not enter the synchronous catch path.

Await setup before invoking the child, await teardown before settling it or restoring mocks, and propagate hook failures while retaining the at-most-once teardown guard. Add a regression check with asynchronous beforeEach and afterEach callbacks. This is incomplete newly added support, not a regression from previously working asynchronous hooks.

2. Validate raw P-521 private scalars before arithmetic

Location: web-crypto.js:3072–3078, scalar loop:2987–2992.

The raw-private P-521 import passes arbitrary-length input to p521PublicPoint before validating the scalar size or range. The helper converts the entire input to BigInt and performs elliptic-curve operations for each bit. A 6,600-byte input filled with 0x55, with its first byte set to 1, took 3,783 ms in the exact extracted helper; Node 26.13.1 createPrivateKey rejected that input with ERR_INVALID_ARG_VALUE in under 1 ms. A 66-byte control was accepted by Node. Invalid input therefore causes avoidable synchronous CPU work before eventual validation.

Validate size/range before deriving the public point. Prefer the existing native P-521 ECDH implementation in web_crypto.rs over this custom, secret-dependent BigInt arithmetic. The comment stating that native ECDH has no P-521 support is stale on this merged head.

Verification and limits

The focused probes ran under Node 26.13.1, not QuickJS/WASM. The hook probe evaluated the actual test.js module with unused argument-validation/error-construction dependencies substituted; the arithmetic probe evaluated the exact helper source. The timing is not a WASM measurement. Exact-head CI run 45798881357 succeeded, but I did not rerun the Rust/WASM suites or historical migration replay. Production-path regression checks remain necessary. No additional confirmed defect was found in the reviewed migration/report contracts.

@noise64
noise64 marked this pull request as draft November 26, 2026 13:33
@noise64

noise64 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Addressed in c7cb37df. Subtests now await asynchronous setup and teardown, restore mocks before settling, and retain at-most-once teardown. Raw P-521 private imports require exactly 66 bytes before native derivation. The custom BigInt arithmetic is removed. The adapter uses the existing fixed-width library remainder and P-521 backend: direct ECDH rejects Node-accepted noncanonical scalars such as n+1. Raw/JWK exports retain the original d. This requires crypto-full; other tiers report unsupported-curve after length validation. Public WASM regressions and pinned Node controls cover these cases. This is not a cryptographic audit or compiled constant-time qualification.

@noise64
noise64 requested a review from vigoo November 26, 2026 20:23
@noise64
noise64 marked this pull request as ready for review November 26, 2026 20:31

@vigoo vigoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed df908bf. Both earlier findings are resolved: asynchronous subtest hooks complete before settlement and mock restoration, and raw P-521 imports validate length before using the native backend instead of custom BigInt arithmetic. Local focused probes passed hook ordering/failure cleanup and invalid-length rejection. Pinned Node 26 controls confirmed the noncanonical-scalar contract. Exact-head CI 46000316443 passed, including the public WASM regressions for hooks and P-521 with and without the backend. No new blocker found in the corrective delta. I did not rerun Rust/WASM locally or qualify constant-time behavior; unrelated merged-main and separately reviewed SQLite changes were excluded from this re-review.

@noise64
noise64 merged commit 2bc23cf into main Nov 27, 2026
60 of 61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants